import request from '@/utils/request.js'

export function getAllDish(storeId) {
	return request({
		url: '/dish-service/dish/getAllDish',  // 只需要填相对路径
		method: 'GET',
		data: { storeId },
	})
}
export function getSpecByDishId(dishId) {
	return request({
		url: '/dish-service/dish/getSpecByDishId',  // 只需要填相对路径
		method: 'GET',
		data: { dishId },
	})
}

export function submitOrders(orderData) {
	console.log('API调用 - submitOrders接收到的orderData:', orderData)
	console.log('API调用 - orderData中的userId:', orderData.userId)
	console.log('API调用 - orderData.userId类型:', typeof orderData.userId)
	
	return request({
		url: '/dish-order-service/order/submitOrders',  // 只需要填相对路径
		method: 'POST',
		data: orderData,
	})
}

export function payOrder(orderNo) {
	return request({
		url: '/dish-order-service/pay/payOrder',  // 只需要填相对路径
		method: 'GET',
		data: { orderNo },
	})
}
